//
//  ModificationViewController.m
//  LvZhi201805
//
//  Created by 付明玉 on 2018/5/17.
//  Copyright © 2018年 付明玉. All rights reserved.
//

#import "ModificationViewController.h"

@interface ModificationViewController ()

@end

@implementation ModificationViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    //背景色
    self.view.backgroundColor = COLOR(251, 251, 251, 1);

    //添加背景边框
    UIView *bgView = [[UIView alloc] init];
    [self.view addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.view.mas_left).offset(0);
        make.right.mas_equalTo(self.view.mas_right).offset(0);
        make.top.mas_equalTo(self.view.mas_top).offset(82);
        make.height.mas_equalTo(100);
    }];
    bgView.layer.borderColor = [COLOR(226, 226, 226, 1) CGColor];
    bgView.layer.borderWidth = 1;
    
    //添加分割线
    UILabel *midLabel = [[UILabel alloc] init];
    [bgView addSubview:midLabel];
    [midLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(0);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.centerY.mas_equalTo(bgView.mas_centerY).offset(0);
        make.height.mas_equalTo(1);
    }];
    midLabel.backgroundColor = COLOR(229, 229, 229, 1);
    
    //用户名
    self.oldPasswordTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.oldPasswordTextFiled];
    [self.oldPasswordTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(14);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top .mas_equalTo(bgView.mas_top).offset(17);
        make.height.mas_equalTo(13);
    }];
    self.oldPasswordTextFiled.placeholder = @"请输入原密码";
    self.oldPasswordTextFiled.textColor = COLOR(102, 102, 102, 1);
    self.oldPasswordTextFiled.font = [UIFont systemFontOfSize:12];
    
    //密码
    self.laterPasswordTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.laterPasswordTextFiled];
    [self.laterPasswordTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(14);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.bottom .mas_equalTo(bgView.mas_bottom).offset(-17);
        make.height.mas_equalTo(13);
    }];
    self.laterPasswordTextFiled.placeholder = @"请输入新密码";
    self.laterPasswordTextFiled.textColor = COLOR(102, 102, 102, 1);
    self.laterPasswordTextFiled.font = [UIFont systemFontOfSize:12];
}

#pragma mark - viewWillAppear
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    //显示导航栏
    self.navigationController.navigationBarHidden = NO;
    
    //标题
    self.navigationItem.title = @"账户设置";
    
    //背景色
    [self.navigationController.navigationBar setBarTintColor:COLOR(18, 79, 151, 1)];
    
    //字体颜色
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    
    //设置返回按钮颜色
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
    //字体
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"AmericanTypewriter-Bold" size:18], NSFontAttributeName, nil]];
    
    //保存按钮
    UIBarButtonItem *navigationRightItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(clickNavigationRightItem)];
    self.navigationController.navigationItem.rightBarButtonItem = navigationRightItem;
    
}

#pragma markv - 点击保存按钮
- (void)clickNavigationRightItem
{
    
    
}

@end
